In [ ]:
%%%timeit
maths = list()
for x in range(10):
maths.append(x**x)
In [ ]:
%%%timeit
maths = [x**x for x in range(10)]
# maths
In [1]:
import matplotlib.pyplot as plt
import math
import numpy as np
%matplotlib inline
In [4]:
t = np.arange(0., 5., 0.2)
plt.plot(t, t, 'r--', t, t**2, 'bs')
Out[4]: